// $Id: nonlinearanalyticconditionalgaussianmobile.h 5374 2005-05-06 14:57:05Z TDeLaet $
// Copyright (C) 2006  Tinne De Laet <first dot last at mech dot kuleuven dot be>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
//


#ifndef __NON_LINEAR_SYSTEM_CONDITIONAL_GAUSSIAN_MOBILE__
#define __NON_LINEAR_SYSTEM_CONDITIONAL_GAUSSIAN_MOBILE__


// 要生成我们自己的类，首先从实现头文件开始：nonlinearanalyticconditionalgaussianmobile.h。
// 在类的实现部分，我们首先包含要继承的父类的头文件：
#include <pdf/analyticconditionalgaussian_additivenoise.h>

// 该类将被创建在 BFL 命名空间中，并且显然需要一个构造函数和一个析构函数。
// 构造函数需要传入一个表示系统噪声的高斯分布
namespace BFL
{
  /// Non Linear Conditional Gaussian
  /**
     - \f$ \mu = Matrix[1] . ConditionalArguments[0] +
     Matrix[2]. ConditionalArguments[1]  + ... + Noise.\mu \f$
     - Covariance is independent of the ConditionalArguments, and is
     the covariance of the Noise pdf
  */


  class NonLinearAnalyticConditionalGaussianMobile : public AnalyticConditionalGaussianAdditiveNoise
    {
    public:
      /// Constructor
      /** @pre:  Every Matrix should have the same amount of rows!
	  This is currently not checked.  The same goes for the number
	  of columns, which should be equal to the number of rows of
	  the corresponding conditional argument!
	  @param ratio: vector containing the different matrices of
	  the linear relationship between the conditional arguments
	  and \f$\mu\f$
	  @param additiveNoise Pdf representing the additive Gaussian uncertainty
      */
      NonLinearAnalyticConditionalGaussianMobile( const Gaussian& additiveNoise);

      /// Destructor
      virtual ~NonLinearAnalyticConditionalGaussianMobile();

      // 查阅 AnalyticConditionalGaussianAdditiveNoise 类的文档可以发现，当继承该类时，我们至少需要实现其中的两个方法：
      // ColumnVector ExpectedValueGet()
      // 该方法将返回条件概率密度函数的期望值，其具体实现需基于我们问题中特定的过程方程（即系统状态转移方程）。
      // Matrix dfGet(unsigned int i)
      // 该方法将返回关于第 i 个条件参数的导数。在本例中，仅与状态变量（即第一个条件参数）相关的导数具有实际意义。
      // 此外，这两个方法是仅有的需要重新实现的函数。因此，我们需要在头文件的public部分添加以下声明：

      // redefine virtual functions
      virtual MatrixWrapper::ColumnVector    ExpectedValueGet() const;
      virtual MatrixWrapper::Matrix          dfGet(unsigned int i)       const;
    };

} // End namespace BFL

#endif //
